var app =angular.module('myApp');
app.controller('f-cContr',["$css","$http","$scope","$rootScope",function ($css,$http,$scope,$rootScope) {
    $css.add("./collect/css/collect.css");
    // console.log($rootScope.Data);
    // $scope.data = $rootScope.Data;
    $scope.data = JSON.parse(localStorage.getItem('collectData'));
    // localStorage.setItem('collectData',JSON.stringify($rootScope.Data))
    // localStorage.setItem('sameData',JSON.stringify($rootScope.sameData))
    // $scope.data = JSON.parse(localStorage.getItem('collectData'));
    // $scope.data.pop();
    // console.log($scope.data);
    // $rootScope.bianji = $scope.data;
    $scope.time1 = new Date();
    $scope.time2 = $scope.time1.getTime();
    // console.log(localStorage.getItem('collectData'));
    // console.log($scope.getData);
    // $scope.time1.setHours($scope.time1.getHours() - 8);
    // localStorage.clear('collectData');
    $rootScope.msgData = [];
    $scope.addMsg = function(){
        console.log(this);
        var obj = {};
        obj.price = this.$$watchers[0].last;
        obj.title = this.$$watchers[1].last;
        obj.count = this.$$watchers[2].last;
        obj.imgUrl = this.$$watchers[3].last;
        obj.sName = this.$$watchers[5].last;
        obj.simgUrl = this.$$watchers[6].last;
        $rootScope.msgData.push(obj);
        localStorage.setItem('shanping',JSON.stringify($rootScope.msgData))
    }
    // console.log($rootScope.Data);

}])
